const {registers,isRegisters} =  require('../dao/lessorsDao');

//出租方注册
module.exports.registers = async lessorsData => {
    const data = await registers(lessorsData);
    if (data._id) {
        return {
            message: '注册成功',
            status: 1
        }
    }
    return {
        message: '注册失败',
        status: 0
    }
}

//出租方验证账号是否存在
module.exports.isRegisters = async isData => {
    const data = await isRegisters(isData);
    if (data.length > 0) {
        return {
            message: '账号已存在，不合法',
            status: 0,
        }
    }
    return {
        message: "账号合法",
        status: 1
    }
}